<template>
	<view class="ml-login">		
		<button @getuserinfo="onGotUserInfo" open-type="getUserInfo">微信登陆</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userName:"",
				pwd:""
			}
		},
		onLoad() {
		},
		onShow() {


		},
		methods: {
			onGotUserInfo(e) {
				console.log(4367398697)
				console.log(e.mp.detail.userInfo)
				this.backPage()
			},
			goLogin() {
				let params = {
					"user_name" : this.userName,
					"password" : this.pwd
				}
				this.$Interface.login.login(params,(res) => {
					console.log(res)				
				})
			},
			backPage() {
				 var pages = getCurrentPages(); // 当前页面
				 var beforePage = pages[pages.length - 2]; // 前一个页面
				 wx.navigateBack({
				     success: function() {
				         beforePage.onLoad(); // 执行前一个页面的onLoad方法
				     }
				 });
			}
		}
	}
</script>

<style lang="scss" scoped="true">



</style>

